import { GetServerSideProps, NextPage, PageConfig } from 'next';
import Head from 'next/head';
import { useEffect, useState } from 'react';
import Title from './title';
import Content from './content';
import getgrades from '../../api/class/getgrades';

interface IProps {
	grades: string[];
}

/**
 * 团队详情
 */
const Page: NextPage<IProps> = ({ grades }) => {
	return (
		<>
			<Head>
				<title>团队详情</title>
			</Head>
			<Title />
			<Content grades={grades} />
		</>
	);
};

export const config: PageConfig = {
	amp: false
};

export default Page;

// pre-render this page on each request
export const getServerSideProps: GetServerSideProps<IProps> = async (context) => {
	const grades = await getgrades();
	return {
		props: {
			grades
		}
	};
};

